extends ../layout
block content
   .container
      div.page-header
         h1 注册表单
      if errors
         each error in errors
            div.alert.alert-danger
               span  #{error.error}
      if success
         div.alert.alert-success
            span  注册成功
            div.pull-right
               a(href="/") 返回主页
      else
         form.login-form.form-horizontal(method="POST",action='/users/register')
            input(name='_csrf',type='hidden',)
            div.form-group
               label.col-sm-4 用户名
               div.col-sm-8
                  input.form-control(
                     placeholder="用户名",
                     type='text',
                     required='true',
                     name='userName',
                     value=userName
                  )
            div.form-group
               label.col-sm-4 密码
               div.col-sm-8
                  input.form-control(
                  placeholder="设置密码",
                  type='password',
                  required='true',
                  name='password'
                  )
            div.form-group
               label.col-sm-4 性别
               div.col-sm-8
                  if gender == 1
                     input(
                     type='radio',
                     required='true',
                     name='gender'
                     value='0')
                     span  男
                     input(
                     type='radio',
                     required='true',
                     name='gender'
                     value='1')
                     span  女
                  else
                     input(
                     type='radio',
                     required='true',
                     name='gender'
                     value='1')
                     span  男
                     input(
                     type='radio',
                     required='true',
                     name='gender'
                     value='0')
                     span  女
            div.form-group
               label.col-sm-4 电子邮件
               div.col-sm-8
                  input.form-control(
                  placeholder="电子邮件",
                  type='email',
                  required='true',
                  name='email',
                  value=email
                  )
            div.form-group
               label.col-sm-4 姓名
               div.col-sm-8
                  input.form-control(
                  placeholder="真实姓名",
                  type='text',
                  required='true',
                  name='realname'
                  value=realname
                  )
            div.form-group
               div.col-sm-offset-4.col-sm-8
                  button.login.btn-primary.btnhhh(type="submit") register

